import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.roaringbitmap.RoaringBitmap;

import java.util.Base64;
import java.util.List;
import java.util.Map;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class RuleInfo {
    // 规则ID
    private String ruleId;

    // 人群圈选条件
    private List<PropertyParam> profileCondition;

    // 事件次数条件
    private Map<String, Integer> eventCountCondition;

    // 人群圈选bitmap
    private RoaringBitmap profileUsersBitmap;

    // 规则条件运算groovy代码
    private String ruleCalculatorCode;

    private String paramId;

    public String getParamId() {
        if (paramId == null) {
            this.paramId = toString().hashCode() + "";
        }
        return paramId;
    }
}
